<!-- File: /app/View/Employees/table_employee.ctp -->
<h1>Table of Employee</h1>
<?php
echo $this->Html->link(
        'Add Employee', array('controller' => 'employees', 'action' => 'add_employee')
);
?>
<table>
    <tr>
        <th>Id</th>
        <th>Name</th>
        <th>Age</th>
        <th>Sexual</th>
    </tr>
    <!-- Here is where we loop through our $posts array, printing out post info -->
    <?php foreach ($employees as $employee): ?>
        <tr>
            <td><?php echo $employee['Employee']['id']; ?></td>
            <td>
                <?php echo $this->Html->link($employee['Employee']['name'], array('controller' => 'employees', 'action' => 'edit_employee', $employee['Employee']['id']));
                ?>
            </td>    
            <td><?php echo $employee['Employee']['age']; ?></td>
            <td><?php echo $employee['Employee']['sexsual']; ?></td>
            <td>
                <?php
                echo $this->Form->postLink(
                        'Delete', array('action' => 'delete_employee', $employee['Employee']['id']), array('confirm' => 'Are you sure?'));
                ?>                
            </td>
        </tr>
<?php endforeach; ?>
    <?php unset($employee); ?>
</table>